<template>
  <div class="notice-container">
    <div style="margin: 20px 0;">
      <div style="display: flex;justify-content: space-between">
        <el-button type="info" @click="$router.go(-1)" size="small">返回</el-button>
      </div>
      <div class="notice-container-content" style="margin: 20px 20px">
        <h2>所有公告</h2>
        <el-timeline reverse>
          <el-timeline-item v-for="notice in notices" :key="notice.id" :timestamp="notice.createDate" placement="top" >
            <el-card>
              <h4>{{ notice.name }}</h4>
              <p>{{ notice.info }}</p>
            </el-card>
          </el-timeline-item>
        </el-timeline>
      </div>
    </div>
  </div>
</template>
<script>
import axios  from "axios";
export default {
  data(){
    return{
      notices:[],
    };
  },
   created() {
     this.request.get("/notice").then((res) => {
       this.notices = res.data;
     });
  }

}
</script>
<style scoped lang="scss">
.notice-container {
  color: #666;
  width: 70%;
  margin: 0 auto
}
</style>